fix(update): replace active binary during self-update#84
Closed
ysyneu wants to merge 1 commit into
Closed
Conversation
ysyneu
commented
Jul 15, 2026
ysyneu
left a comment
Contributor
Author
There was a problem hiding this comment.
Review blockers:P1)更新流程没有强制 installer 使用已检查的 expected version,继承 FLASHDUTY_VERSION 或 latest 漂移会先替换/降级活动二进制再报错;P1)installer 直接从临时目录覆盖活动文件,验证发生在替换后,跨文件系统不原子且无回滚;P2)sudo mv 可能把 root-owned 文件变为调用用户所有;P3)测试用假 sh 直接写目标,未覆盖真实 install.sh 的 mv/权限/回滚语义。应在目标目录同文件系统 staging,验证 staged binary 后保留 owner/mode 原子替换,并固定 expected version。当前不能合并。
Contributor
Author
|
关闭:当前方案在验证前直接替换活动二进制,存在版本漂移、跨文件系统非原子覆盖、无回滚和 sudo 所有权风险。runner 场景已改走“runner owns CLI,禁止自更新”的更小边界;standalone 自更新若继续做,需重新设计同目录 staging、预验证、保留 owner/mode、原子 rename。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Audit evidence
Production session
sess_6cLDsewKHez6eMaGjU5BDTranfduty update, but the installer wrote~/.local/bin/flashdutywhile the active entry remained~/.flashduty/bin/fdutyv1.3.6.Verification
make GOLANGCI_LINT=/tmp/fc-safari-audit-tools/golangci-lint-current(fmt, lint, race tests, build)go test -race ./internal/cli -run 'TestRunInstaller(UpdatesInvokedBinary|RejectsShadowedInstall)' -count=1\n-/simplify --uncommitted\n-/review-to-main --uncommitted\n-/review-to-main